<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@include file="/include/public.jspf"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-base.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-common.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/p-all.css" />

<script type="text/javascript" src="${path }/js/jquery1.10.2.min.js"></script>
<script type="text/javascript" src="${path }/js/lib/zepto.js"></script>
<script type="text/javascript" src="${path }/js/common/base.js"></script>
<script type="text/javascript" src="${path }/js/lib/lib.js"></script>

<title>魔环金融</title>
</head>
<body>
 <div class="ui_title">
        <a class="ui_back" href="javascript:void(0)" onclick="window.history.back();"><i class="ui_icon_back"></i>返回</a>
        回款计划</div>
    <section class="m-main p_account_loan">
        <ul class="ui_tab_nav ui_tab_num2">
            <li class="select"><a href="javascript:void(0);">待回款</a></li>
            <li><a href="javascript:void(0);">已回款</a></li>
        </ul>
        <div class="loan_box">
            <div class="tab0">
                <div class="content ui_border_b"></div>
                <div class="ui_loadmore_text"><a href="javascript:void(0);">点击加载更多</a></div>
            </div>
            <div class="tab1" style="display:none;">
                <div class="content ui_border_b"></div>
                <div class="ui_loadmore_text"><a href="javascript:void(0);">点击加载更多</a></div>
            </div>
        </div>
    </section>
    <script>
    var tabHash = {
        tab0 : new P2PWAP.ui.P2PLoadMore($(".tab0 .content")[0], $('.tab0 .ui_loadmore_text')[0], '/account/ajax_loan?type=1',1),
        tab1 : new P2PWAP.ui.P2PLoadMore($(".tab1 .content")[0], $('.tab1 .ui_loadmore_text')[0], '/account/ajax_loan?type=2',1)
    }
    tabHash.tab0.timeYM = tabHash.tab1.timeYM = '';
    tabHash.tab0.createItem = tabHash.tab1.createItem = function(item){
        var timeYM = P2PWAP.util.dataFormat(item.time, 'y年m月');
        var titleDiv = '';
        var div = document.createElement("dl");
        var html = '';
        html += '<dt>';
        html += '    <p class="f15">' + P2PWAP.util.dataFormat(item.time, 'm-d') + '</p>';
        html += '    <p class="gray_v1">' + item.name + '</p>';
        html += '</dt>';
        html += '<dd>';
        html += '    <div class="ui_middle">';
        html += '        <p class="red_v1 f15">' + (item.money * 1).toFixed(2) + '元</p>';
        html += '        <p class="gray_v1">' + item.type + '</p>';
        html += '    </div>';
        html += '</dd>';
        div.innerHTML = html;
        div.className = 'ui_con_jl';
        if (timeYM != this.timeYM) {
            titleDiv = document.createElement("div");
            titleDiv.innerHTML = timeYM;
            titleDiv.className = 'ui_plan_title';
            this.timeYM = timeYM;
            return [titleDiv, div];
        } else {
            return div;
        }
    }

    var _loadNotFirstpage = [];
    tabHash.tab0.preloadPage(_loadNotFirstpage,1);
    $('.ui_tab_nav li').click(function() {
        if($(this).hasClass('select')) return;
        var idx = $(this).index();
        var $con = $('.tab' + idx);
        $(this).addClass('select').siblings().removeClass('select');
        $con.show().siblings().hide();
        tabHash['tab' + idx].timeYM = '';
        tabHash['tab' + idx].refresh();
     });
    </script>
</body>
</html>